/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import commom.VirtualMachine;
import java.util.ArrayList;
import java.util.UUID;
import simulation.VMTask;

/**
 *
 * @author gravena
 */
public class TestSpecSlave {
    private UUID vm; /* UUID of the virtual machine */
    private VMTask task;
    private UUID id; /* ID of the Test that this TestSpec belongs to */

    public TestSpecSlave(UUID vm, VMTask task, UUID id) {
        this.vm = vm;
        this.task = task;
        this.id = id;
    }

    public UUID getVm() {
        return vm;
    }

    public void setVm(UUID vm) {
        this.vm = vm;
    }

    public VMTask getTask() {
        return task;
    }

    public void setTask(VMTask task) {
        this.task = task;
    }

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }
    
    public VirtualMachine getVm(ArrayList<VirtualMachine> list) {        
        for(int i=0;i<list.size();i++) {
            if(list.get(i).getUUID().compareTo(vm) == 0) {
                return list.get(i);
            }
        }
        
        return null;
    }
}
